#ifndef __VIDEOIN_H
#define __VIDEOIN_H

#include <types.h>

/* Video In ioctl */
#define FBIOCTL_SET_VIBASE      0x4650
#define FBIOCTL_GET_VIBASE      0x4651
#define FBIOCTL_GET_VI_HEIGHT   0x4652
#define FBIOCTL_GET_VI_WIDTH    0x4653
#define FBIOCTL_SET_VI_FRMSZ    0x4654
#define FBIOCTL_SET_VI_CTRL     0x4655
#define FBIOCTL_GET_VI_CTRL     0x4656
#define FBIOCTL_GET_VI_LINE     0x4657
#define FBIOCTL_GET_VI_PIXEL    0x4658
#define FBIOCTL_SET_VI_SMTB     0x4659
#define FBIOCTL_GET_VI_SMTB     0x465A
#define FBIOCTL_SET_VI_SMTD     0x465B
#define FBIOCTL_GET_VI_SMTD     0x465C
#define FBIOCTL_VI_CHENNEL_SEL  0x465D
#define FBIOCTL_FB_SWITCH_START 0x465E
#define FBIOCTL_FB_SWITCH_STOP  0x465F

#define VI_CONTROL_INV_MODE0    0x00
#define VI_CONTROL_INV_MODE1    0x01
#define VI_CONTROL_INV_DCLK     0x04
#define VI_CONTROL_INV_DE       0x08
#define VI_CONTROL_INV_HS       0x10
#define VI_CONTROL_INV_VS       0x20
#define VI_CONTROL_EN           0x80000000

void vi_enable();
void vi_disable();
void vi_control(u32 ctrl);
void vi_set_fb_addr(u32 addr);
void vi_set_frame_size(u16 width, u16 height);
u32 vi_get_fb_addr(void);
void vi_info();

#endif
